package com.entity.summaryorder;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("summary_orders") // 映射到数据库表名
@ApiModel("技术服务总结单实体类")
public class ServiceSummaryOrder {

    @ApiModelProperty(value = "主键，唯一标识每条服务总结单")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "任务单ID，对应任务单表的主键（逻辑外键）")
    @TableField("task_id")
    private Long taskId;

    @ApiModelProperty(value = "服务单号，唯一标识每条服务记录，不能为空")
    @TableField("service_number")
    private String serviceNumber;

    @ApiModelProperty(value = "服务实施人ID")
    @TableField("service_implementer_id")
    private Long serviceImplementerId;

    @ApiModelProperty(value = "服务完成日期，格式为YYYY-MM-DD")
    @TableField("completion_date")
    private LocalDate completionDate;

    @ApiModelProperty(value = "客户公司ID")
    @TableField("customer_company_id")
    private Long customerCompanyId;

    @ApiModelProperty(value = "客户联系人ID")
    @TableField("customer_contacts_id")
    private Long customerContactsId;

    @ApiModelProperty(value = "销售经理ID")
    @TableField("sales_manager_id")
    private Long salesManagerId;

    @ApiModelProperty(value = "服务地点")
    @TableField("service_location")
    private String serviceLocation;

    @ApiModelProperty(value = "工作明细描述")
    @TableField("work_details")
    private String workDetails;

    @ApiModelProperty(value = "确认人盖章时间")
    @TableField("confirmation_stamp")
    private String confirmationStamp;

    @ApiModelProperty(value = "创建时间，默认为当前时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间，每次更新时自动刷新")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除标志，默认为1，0表示已删除")
    @TableField("is_deleted")
    private Integer isDeleted;

    @ApiModelProperty(value = "制表人（当前登录用户名）")
    @TableField("created_by")
    private String createdBy;

    @ApiModelProperty(value = "图片预处理URL")
    @TableField("images_url")
    private String imagesUrl;

    @ApiModelProperty (value = "状态")
    @TableField("status")
    private String status;
}